import React from 'react';
import { Dispatch } from 'react';

/** 供应商新增编辑页面上下文类型 */
export interface ISupplierLocaldataContext {
  updateFixCls: string;
  curRes: Record<string, any>;
  locationID: string;
  supplierDispath: Dispatch<any>;
  contactsSwitchList: Record<string, any>[];
  supplierInfoObj: Record<string, any>;
  memoirImageRenderID: string;
  reloadDetailInfo: () => void;
  contactsCurrent: number;
  qualifyDataList: Record<string, any>[];
  memoirDataList: Record<string, any>[];
  supplierCompannyName?: string;
  locationProps: Record<string, any>;
}

/** 供应商新增编辑上下文 */
const INIT_SUPPLIERLOCALDATA_VALUE: ISupplierLocaldataContext = {
  updateFixCls: '',
  curRes: {},
  locationID: '',
  supplierDispath: () => {},
  contactsSwitchList: [],
  supplierInfoObj: {},
  memoirImageRenderID: '',
  reloadDetailInfo: () => {},
  contactsCurrent: 0,
  qualifyDataList: [],
  memoirDataList: [],
  supplierCompannyName: '',
  locationProps: {},
};

const SupplierLocaldataContext = React.createContext<ISupplierLocaldataContext>(INIT_SUPPLIERLOCALDATA_VALUE);

export { SupplierLocaldataContext };
